﻿
using DtoFw;
using DtoFw.Interface;
using DtoFw.Query;
using DtoFw.Result;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SceneEvidenceAPISDK
{
    public class ApiRole : Base, IRole
    {
        /// <summary>
        /// 更新角色
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public BaseResult AddRole(RoleEditInfo request)
        {
            return HttpTools.Post<BaseResult>(
                request, base.GetApiRouter("AddRole"));
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BaseResult DeleteRoles(DeleteDto query)
        {
            return HttpTools.Delete<BaseResult>(query,
                base.GetApiRouter("DeleteRoles"));
        }
        /// <summary>
        /// 查询角色菜单
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BaseGenericResult<RoleMapMenuResult> GetRoleMapMenus(RoleQuery query)
        {
            return HttpTools.Get<BaseGenericResult<RoleMapMenuResult>>(query,
                  base.GetApiRouter("GetRoleMapMenus"));
        }
        /// <summary>
        /// 查询分页
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BaseGenericResult<Pager<RoleResult>> Query(BaseQuery query)
        {
            return HttpTools.Get<BaseGenericResult<Pager<RoleResult>>>(query,
                 base.GetApiRouter("Query"));
        }
        /// <summary>
        /// 查询指定角色
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        public BaseGenericResult<RoleResult> QueryRole(long roleId)
        {
            return HttpTools.Get<BaseGenericResult<RoleResult>>(base.GetApiRouter("QueryRole",
                roleId.ToString()));
        }
    }
}
